<script>
window.addEventListener("message", function (evt) {
    try {
        top.fail();
    } catch(e) {
        top.postMessage("step1-done", "*");
    }
}, false);

top.postMessage("step1-ready", "*");
</script>
